use crate::{client::RedisClient, resp::Command, RedisResult};

impl RedisClient {
    pub async fn info(&self, section: Option<&str>) -> RedisResult<String> {
        let mut cmd = Command::new("INFO");
        if let Some(section) = section {
            cmd.arg_append(section);
        }
        self.send_command(cmd).await
    }

    pub async fn bgsave(&self, is_schedule: bool) -> RedisResult<String> {
        let mut cmd = Command::new("BGSAVE");
        if is_schedule {
            cmd.arg_append("SCHEDULE");
        }
        self.send_command(cmd).await
    }
}
